<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" errorPage="500.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.duyiedu.com" prefix="myFn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>订单详情</title>
		<link rel="stylesheet" href="css/reset.css">
    	<link rel="stylesheet" href="css/orderDetails.css">
    	<link rel="stylesheet" href="css/common.css">
    	<!-- 小图标 -->
  		<link rel="icon" href="css/favicon.ico" type="image/x-icon" />
    	<script src="js/jquery-1.12.4.js"></script>
	</head>
<body>
	<!-- 头部 -->
	<div class="header">
    	<div class="header-inner">
	      	<h1>
	        	<a href="index.html" class="logo">太平洋影城</a>
	      	</h1>
      		<div class="nav">
	        	<ul class="navbar">
		          	<li>
		            	<a href="index">首页</a>
		          	</li>
	          		<li>
	            		<a href="hotFilm.do">电影</a>
	          		</li>
	          		<li>
	            		<a href="#">影院</a>
	          		</li>
	          		<li>
	            		<a href="#">演出</a>
	          		</li>
		          	<li>
		            	<a href="billboard.do">榜单</a>
		          	</li>
	          		<li>
	            		<a href="#">热点</a>
	          		</li>
	          		<li>
	            		<a href="#">商城</a>
	          		</li>
	        	</ul>
      		</div>
      		<div class="user-info">
        		<div class="user-avatar J-login">
	          		<c:choose>
	       				<c:when test="${sessionScope.userLogin !=null}">
	         				<img src="${sessionScope.userLogin.uImg}">
	       				</c:when>
	       				<c:otherwise>
	         				<img src="img/top_img/default_head.png">
	       				</c:otherwise>
	     			</c:choose>
	     			<span class="caret"></span>
	     			<c:choose>
	       				<c:when test="${sessionScope.userLogin !=null}">
	         				<ul class="user-menu yes-login-menu">
					           	<li class="text">
					             	<a href="order.do?uid=${sessionScope.userLogin.uId}">我的订单</a>
					           	</li>
					           	<li class="text login-name" >
					             	<a href="userEssential.do?uId=${sessionScope.userLogin.uId}">基本信息</a>
					           	</li>
					           	<li class="text">
					             	<a href="exit.do" class="J-logout">退出登录</a>
					           	</li>
	         				</ul>
	       				</c:when>
				       	<c:otherwise>
				         	<ul class="user-menu no-login-menu">
					           	<li>
					           		<a href="login.jsp">登录</a>
					           	</li>
				         	</ul>
				       	</c:otherwise>
	     			</c:choose>
      			</div>
    		</div>
		    <form action="searchFilm.do" method="post" class="search-form">
		      	<input name="kw" class="search" type="search" maxlength="32" placeholder="找影视剧、影人、影院">
		      	<input class="submit" type="submit" value="">
		    </form>
    		<div class="app-download">
		      	<a href="#">
		        	<span class="iphone-icon"></span>
		        	<span class="apptext">APP下载</span>
		        	<span class="caret"></span>
		        	<div class="download-icon">
		          		<p class="down-title">扫码下载APP</p>
		          		<p class="down-content">选座更优惠</p>
		        	</div>
		      	</a>
    		</div>
  		</div>
	</div>
	<!-- 占位符 -->
    <div class="header-placeholder"></div>
    <!-- 内容部分 -->
    <div class="container">
        <div class="order-container">
            <div class="status-box ${sessionScope.orderDetails[0].orderFlag == 0 ? 'unpaid' : 'finished'}">
                <p class="title">${sessionScope.orderDetails[0].orderFlag == 0 ? '待支付' : '已完成'}</p>
                <c:if test="${sessionScope.orderDetails[0].orderFlag == 0}">
                	<p class="desc">
                   	 	请在<span class="minute">15</span>分钟<span class="second">00</span>秒内完成支付
                	</p>
                </c:if>
            </div>
            <div class="order-note">
                <span class="order-id">猫眼订单号:${sessionScope.orderDetails[0].orderNum}</span>
                <span class="contact">（有订单问题可拨打猫眼客服电话<i>1010-5335</i>，工作时间: 9:00-24:00）</span>
            </div>
            <table class="order-table">
                <thead>
                    <tr>
                    <th>影片</th>
                    <th>时间</th>
                    <th>影院</th>
                    <th>座位</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                    <td class="movie-name">《${sessionScope.orderDetails[0].showings.film.filmName}》</td>
                    <td class="showtime">${myFn:dateToWeek(sessionScope.orderDetails[0].datetime)} ${myFn:formatDate(sessionScope.orderDetails[0].date)} ${myFn:formatTime(sessionScope.orderDetails[0].time)}</td>
                    <td class="cinema-name">万达影城（龙泉驿万达广场杜比影院店</td>
                    <td>
                        <span class="hall">${sessionScope.orderDetails[0].showings.filmOffice.offName}</span>
                        <div class="seats">
	                        <div>
	                       		<c:forEach items="${sessionScope.orderDetails[0].seats}" varStatus="curr" var="seat">
	                               	<span class="${curr.first?'':'border'}"><i>${myFn:dealSeat(seat.seatNumber)[0]}</i>排<i>${myFn:dealSeat(seat.seatNumber)[1]}</i>座</span>
	                            </c:forEach>
	                        </div>
                        <div>
                        </div>
                        </div>
                    </td>
                    </tr>
                </tbody>
            </table>
            <div class="order-bottom">
                <div class="clearfix">
                    <div class="cinema-info">
                        <p class="name">万达影城（龙泉驿万达广场杜比影院店</p>
                        <p class="address">地址: 龙泉驿区龙泉街道创业北街8号万达广场4楼</p>
                        <p class="phone">电话: 4000806060</p>
                    </div>
                    <div class="price-box">
                        <span>总价:</span>
                        <span class="price">
                        	<fmt:formatNumber type="number" value="${sessionScope.orderDetails[0].showings.showingsPrice * fn:length(sessionScope.orderDetails[0].seats)}" pattern="#.0" />
                        </span>
                    </div>
                </div>
                <c:if test="${sessionScope.orderDetails[0].orderFlag == 0}">
                	<div class="btn-wrapper">
                    	<div class="pay-btn">立即支付</div>
                	</div>
                	<script type="text/javascript">
                		$(function(){
                			TimeDown(900);
                		})
                	</script>
                </c:if>
            </div>
        </div>
        <div class="timeOut">
        	<div class="modal-container" style="display:none">
	            <div class="modal">
	              	<span class="icon"></span>
	              	<p class="tip">支付超时，该订单已失效，请重新购买</p>
	              	<div class="ok-btn btn">我知道了</div>
	            </div>
	        </div>
        </div>
        <div class="mask">
            <div class="modal-container" style="display: none;">
                <div class="modal">
                    <span class="icon"></span>
                    <p class="tip">您确定要支付吗？点击确定即可完成支付</p>
                    <div class="short btn ok-btn">确定</div>
                    <div class="short btn cancel-btn">取消</div>
                </div>
            </div>
        </div>
        <div class="pay-ok">
            <div class="modal-container" style="display: none;">
                <div class="modal">
                    <span class="icon"></span>
                    <p class="tip">支付成功</p>
                    <div class="short btn ok-btn">查看订单</div>
                    <div class="short btn back">返回首页</div>
                </div>
            </div>
        </div>
        <input type="hidden" value="${sessionScope.orderDetails[0].orderNum}" id="orderNum">
        <input type="hidden" value="${sessionScope.userLogin.uId}" id="uid">
    </div>
    <!-- 底部 -->
	<div class="footer">
    	<div class="content">
      		<div class="moduleBox">
        		<div class="informationBox">
          			<div class="copy_van">
            			<a class="ycgg" href="">
            				<span>影城公告</span>
            			</a>
            			<ul>
              				<li>影城公告</li>
            			</ul>
          			</div>
          			<div class="copy_van">
            			<a class="ycgg" href="">
            				<span>会员中心</span>
            			</a>
			            <ul>
			              	<li>加入会员</li>
			              	<li>会员活动</li>
			              	<li>会员优惠</li>
			            </ul>
          			</div>
          			<div class="copy_van">
            			<a class="ycgg" href="">
            				<span>影片资讯</span>
            			</a>
			            <ul>
			              	<li>正在热映</li>
			              	<li>即将上映</li>
			            </ul>
          			</div>
		          	<div class="copy_van">
		            	<a class="ycgg" href="">
		            		<span>影城活动</span>
		            	</a>
		            	<ul>
		              		<li>影城活动</li>
		              		<li>电影资讯</li>
		            	</ul>
		          	</div>
		          	<div class="copy_van">
		            	<a class="ycgg" href="">
		            		<span>关于我们</span>
		            	</a>
			            <ul>
			              	<li>影城介绍</li>
			              	<li>影院介绍</li>
			              	<li>联系我们</li>
			            </ul>
		          	</div>
        		</div>
        		<div class="abc">
          			<div class="textFloat">
            			<div class="erwei1">
                        	<span class="spans ">
                               	<img class="img1" src="img/foot_img/wxerweima.png" alt="">
                            </span>
              				<span class="spans spanss">
                            	<a href="">微信在线购票</a>
                            </span>
            			</div>
            			<div class="erwei2">
                            <span class="spans">
                        		<img class="img1" src="img/foot_img/xcx.jpg" alt="">
                            </span>
              				<span class="spans spanss">
                                <a href="">小程序在线购票</a>
                            </span>
            			</div>
          			</div>
        		</div>
        		<div class="right_information">
		          	<ul class="ul1">
		            	<li class="lis1">连锁热线：</li>
		            	<li class="lis2">400-850-3366</li>
		          	</ul>
		          	<ul class="ul1">
		            	<li class="lis3">官方微信：</li>
		            	<li class="lis4">搜索“猫眼电影”</li>
		          	</ul>
        		</div>
		        <div class="top_btn">
                    <span>
                       	<a href="javascript:void(0)" id="top">TOP</a>
                    </span>
		        </div>
      		</div>
	      	<div class="foot_text">
	       		<div class="foot"> 版权所有(C)猫眼电影投资有限公司　　技术支持：3-1-501</div>
      		</div>
    	</div>
  	</div>
</body>
<script src="js/orderDetails.js"></script>
</html>